package com.kzn.controller;


import com.kzn.entity.RewardPoints;
import com.kzn.service.IRewardPointsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author sorclown
 * @since 2022-02-05
 */
@RestController
@RequestMapping("/api/reward-points")
public class RewardPointsController {
    private IRewardPointsService rewardPointsService;

    public RewardPointsController() {
    }

    @Autowired
    public RewardPointsController(IRewardPointsService rewardPointsService) {
        this.rewardPointsService = rewardPointsService;
    }

    @RequestMapping(value = "getRewardPointsById", method = RequestMethod.GET)
    public Integer getRewardPointsById(@RequestParam Integer crowdId) {
        RewardPoints rewardPoints = rewardPointsService.getById(crowdId);
        return rewardPoints.getPoint();
    }

}
